<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/page/common/public.jspf"%>
<%@ page import="com.hengpeng.itfints.tools.PageUtil"%>
<% 
	PageUtil pageUtil = (PageUtil)request.getAttribute("PageUtil");
%>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="${skin}/v1.min.css?v=${v}" />
<link rel="stylesheet" type="text/css" href="${skin}/index.css?v=${v}" />
<link href="${skin}/account_personalset.css?v=${v}" type="text/css"
	rel="stylesheet">

<link rel="stylesheet" type="text/css" href="${skin }/paginate.v1.css">
<link rel="stylesheet" type="text/css"
	href="${skin}/user_web2.css?v=${v}" />

<script type="text/javascript"
	src="${path }/js/jquery1.10.2.min.js?v=${v}"></script>
<script type="text/javascript" src="${path }/js/v1.min.js?v=${v}"></script>
<title>${configUtil.sitename}-已投项目</title>
<style>
.yqjilu thead tr {
	border-bottom: 1px solid #e5e5e5;
}
</style>
</head>

<body>
	<!-- head -->
	<c:import url="../../include/top.jsp"></c:import>

	<div class="wrap">
		<div class="blank"></div>
		<div class="user_nav f_l mr5">
			<c:import url="../left.jsp"><c:param name="type" value="invested"></c:param></c:import>
		</div>
		<div class="user_right f_l">
			<div class="user_right">
						<div class="user_right_box mb15 user_right_box_v2">
							<div class="user_title">
								<h1>
									<i class="ico_xiangmu"></i>已投项目
								</h1>
							</div>
							<input type="hidden" name="investInfoStatus"
								id="investInfoStatus" value="${investInfoStatus}" />
							<div class="screening clearfix">
								<div class="select_box" data-name="status">
									<div class="j_select">
									</div>
									<ul class="select_ul none j_selectContent">
									<li data-value="SUCESS">投标成功</li>
									<li data-value="INVESTING">投标中</li>
										<li data-value="LOANED">回款中</li>
										<li data-value="RETURNED">已回款</li>
									</ul>
								</div>
								<input type="hidden" name="type" value="" />
								<div class="sel_time">
									<span>时间</span> <input type="text" class="time_box"
										id="dateInput1" name="date_start" value="${startTime }"><span
										class="pl10">-</span><input type="text" class="time_box"
										id="dateInput2" name="date_end" value="${endTime }">
								</div>
								<input type="button" value="筛选" class="button_shaixian fr">
							</div>
							<c:if test="${fn:length(myInvestList) > 0}">
							<table class="yqjilu" height="226">
								<colgroup>
									<col width="200">
									<col width="80">
									<col width="100">
									<col width="100">
									<col width="80">
								</colgroup>
								<thead>
									<tr>
										<th>标的名称</th>
										<td>年化率</td>
										<td>投资时间</td>
										<td>投资金额</td>
										<td>状态</td>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${myInvestList}" var="invest" varStatus="vstatus">
										<c:choose>
									<c:when test="${vstatus.index%2 == 0}">
										<tr class="tr_bg">
											<th>${invest.borrowName}</th>
											<td>${invest.borrowRate}%</td>
											<td><fmt:formatDate value="${invest.investTime}" type="both"
															pattern="yyyy/MM/dd" /></td>
											<td><fmt:formatNumber value="${invest.investMoney/100}" type="currency" pattern="0"/></td>
											<td>
											<c:choose>
											<c:when test="${invest.status eq 'INVESTING'}">投标中</c:when> 
											<c:when test="${invest.status eq 'SUCESS'}">投标成功</c:when> 
									     <c:when test="${invest.status eq 'RETURNED'}">已回款</c:when> 
									     <c:when test="${invest.status eq 'LOANED'}">回款中</c:when></c:choose> </td>
										</tr>
										</c:when>
										<c:otherwise>
										<tr>
											<th>${invest.borrowName}</th>
											<td>${invest.borrowRate}%</td>
											<td><fmt:formatDate value="${invest.investTime}" type="both"
															pattern="yyyy/MM/dd" /></td>
											<td><fmt:formatNumber value="${invest.investMoney/100}" type="currency" pattern="0"/></td>
											<td>
											<c:choose>
											<c:when test="${invest.status eq 'INVESTING'}">投标中</c:when> 
											<c:when test="${invest.status eq 'SUCESS'}">投标成功</c:when> 
									     <c:when test="${invest.status eq 'RETURNED'}">已回款</c:when> 
									     <c:when test="${invest.status eq 'LOANED'}">回款中</c:when></c:choose> </td>
										</tr>
										</c:otherwise>
										</c:choose>
									</c:forEach>
								</tbody>
							</table>
							</c:if>
						</div>
						<c:if test="${fn:length(myInvestList) <=0}">
						<section>
							<div class="project clearfix u_zijin">
								<div class="pro_detailed clearfix">
									<div class="empty-box">没有记录</div>
								</div>
							</div>
						</section>
						</c:if>
			</div>
			<c:import url="../../include/true_paging.jsp"></c:import>
			<script>
			$(".button_shaixian").click(function(){
				var vstatus = $('#status').val();
				var startTime = $('#dateInput1').val();
				var endTime = $('#dateInput2').val();
				window.location.href = "<%=request.getContextPath()%>/investInfo/myInvestList.htm?curPage=1&investInfoStatus="+vstatus+"&startInvestTime="+startTime+"&endInvestTime="+endTime;
			});
			</script>
		</div>

		<div class="blank"></div>
	</div>

	<c:import url="../../include/foot.jsp"></c:import>

	<script type="text/javascript">
	//分页
	function go (page,pageCount) {
		var startTime = $('#dateInput1').val();
		var endTime = $('#dateInput2').val();
		window.location.href = "<%=request.getContextPath()%>/investInfo/myInvestList.htm?curPage="+page+"&investInfoStatus="+$("#investInfoStatus").val()+"&startInvestTime="+startTime+"&endInvestTime="+endTime;
	}
	//状态查询
	function select (investInfoStatus) {
		window.location.href = "<%=request.getContextPath()%>/investInfo/myInvestList.htm?curPage=1&investInfoStatus="+investInfoStatus;
	}
	//查看收款计划
	function myreceiveplan (borrowInfoId, userId) {
		window.location.href = "<%=request.getContextPath()%>/repayment/myReceivePlanList.htm?borrowInfoId="+borrowInfoId+"&investUserId="+userId;
	}
	$(function(){
		var vstatus = '${investInfoStatus}';
		if(vstatus == 'SUCESS'){
			$('.j_select').text('投标成功');
			$('#status').attr("value","SUCESS")
		}else if(vstatus == 'INVESTING'){
			$('.j_select').text('投标中');
			$('#status').attr("value","INVESTING")
		}else if(vstatus == 'LOANED'){
			$('.j_select').text('回款中');
			$('#status').attr("value","LOANED")
		}else if(vstatus == 'RETURNED'){
			$('.j_select').text('已回款');
			$('#status').attr("value","RETURNED")
		}
	});
</script>
</body>
</html>